<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        //slice() 数组截取，返回被截取元素的新数组，对原数组无影响
        var arr = [1,2,3,4,5];
        console.log(arr.slice());    //无参数，默认截取数组，截取范围：[0,len-1]
        console.log(arr.slice(1));   //有参数start，从start开始截取数组，截取范围：[start,len-1]
        console.log(arr.slice(1,2)); //有参数start和end，从start开始截取数组，截取范围：[start,end-1]
        console.log(arr);            //查看slice()方法对原数组的影响
    </script>
</head>
<body>
    
</body>
</html>